USE [AmazonMWS]
GO

/****** Object:  Table [con].[AdRelease]    Script Date: 10/29/2015 20:23:54 ******/
SET ANSI_NULLS ON
GO

SET QUOTED_IDENTIFIER ON
GO

CREATE TABLE [con].[AdRelease](
	[AdReleaseID] [int] IDENTITY(1,1) NOT NULL,
	[SiteId] [int] NOT NULL,
	[AccountId] [int] NOT NULL,
	[AmazonItemOperationId] [int] NOT NULL,
	[SKU] [nvarchar](50) NOT NULL,
	[ASIN] [nvarchar](50) NULL,
	[ProductInfoModel] [nvarchar](max) NULL,
	[ProductImageModel] [nvarchar](max) NULL,
	[ProductPriceModel] [nvarchar](max) NULL,
	[ProductInventoryModel] [nvarchar](max) NULL,
	[ProductRelationshipModel] [nvarchar](max) NULL,
	[Levels] [int] NULL,
	[StartTime] [datetime] NULL,
	[EndTime] [datetime] NULL,
	[ApiOperationType] [nvarchar](20) NULL,
	[ApiOperationStatus] [nvarchar](20) NULL,
	[ApiOperationRemark] [nvarchar](500) NULL,
	[IsDel] [bit] NULL,
	[CreateUser] [nvarchar](20) NULL,
	[CreateTime] [datetime] NULL,
	[UpdateUser] [nvarchar](20) NULL,
	[UpdateTime] [datetime] NULL,
 CONSTRAINT [PK__AdReleas__8AA77A42681373AD] PRIMARY KEY CLUSTERED 
(
	[AdReleaseID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]

GO

ALTER TABLE [con].[AdRelease] ADD  CONSTRAINT [DF__AdRelease__Level__69FBBC1F]  DEFAULT ((0)) FOR [Levels]
GO

ALTER TABLE [con].[AdRelease] ADD  CONSTRAINT [DF__AdRelease__IsDel__6AEFE058]  DEFAULT ((0)) FOR [IsDel]
GO

ALTER TABLE [con].[AdRelease] ADD  CONSTRAINT [DF__AdRelease__Creat__6BE40491]  DEFAULT ('Pu') FOR [CreateUser]
GO

ALTER TABLE [con].[AdRelease] ADD  CONSTRAINT [DF__AdRelease__Creat__6CD828CA]  DEFAULT (getdate()) FOR [CreateTime]
GO

ALTER TABLE [con].[AdRelease] ADD  CONSTRAINT [DF__AdRelease__Updat__6DCC4D03]  DEFAULT ('FL') FOR [UpdateUser]
GO

ALTER TABLE [con].[AdRelease] ADD  CONSTRAINT [DF__AdRelease__Updat__6EC0713C]  DEFAULT (getdate()) FOR [UpdateTime]
GO

USE [AmazonMWS]
GO

/****** Object:  Table [mws].[FeedsInfo]    Script Date: 10/29/2015 20:24:01 ******/
SET ANSI_NULLS ON
GO

SET QUOTED_IDENTIFIER ON
GO

CREATE TABLE [mws].[FeedsInfo](
	[FeedsInfoID] [int] IDENTITY(1,1) NOT NULL,
	[AmazonEnvelope] [text] NOT NULL,
	[AdReleaseIdList] [nvarchar](3000) NOT NULL,
	[ApiOperationType] [nvarchar](30) NOT NULL,
	[ApiOperationStatus] [nvarchar](20) NOT NULL,
	[FeedSubmissionId] [nvarchar](50) NULL,
	[FeedType] [nvarchar](100) NULL,
	[SubmittedDate] [nvarchar](30) NULL,
	[FeedProcessingStatus] [nvarchar](50) NULL,
	[StartedProcessingDate] [datetime] NULL,
	[CompletedProcessingDate] [datetime] NULL,
	[ResultData] [text] NULL,
	[IsDel] [bit] NULL,
	[CreateUser] [nvarchar](50) NULL,
	[CreateTime] [datetime] NULL,
	[UpdateUser] [nvarchar](50) NULL,
	[UpdateTime] [datetime] NULL,
 CONSTRAINT [PK__FeedsInf__46FE6EA0793DFFAF] PRIMARY KEY CLUSTERED 
(
	[FeedsInfoID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]

GO

ALTER TABLE [mws].[FeedsInfo] ADD  CONSTRAINT [DF__FeedsInfo__IsDel__7B264821]  DEFAULT ((0)) FOR [IsDel]
GO

ALTER TABLE [mws].[FeedsInfo] ADD  CONSTRAINT [DF__FeedsInfo__Creat__7C1A6C5A]  DEFAULT ('Pu') FOR [CreateUser]
GO

ALTER TABLE [mws].[FeedsInfo] ADD  CONSTRAINT [DF__FeedsInfo__Creat__7D0E9093]  DEFAULT (getdate()) FOR [CreateTime]
GO

ALTER TABLE [mws].[FeedsInfo] ADD  CONSTRAINT [DF__FeedsInfo__Updat__7E02B4CC]  DEFAULT ('FL') FOR [UpdateUser]
GO

ALTER TABLE [mws].[FeedsInfo] ADD  CONSTRAINT [DF__FeedsInfo__Updat__7EF6D905]  DEFAULT (getdate()) FOR [UpdateTime]
GO


